#define _CRT_SECURE_NO_WARNINGS 1


#include <stdio.h>

int main()
{
	int n, k;
	int count1 = 0;
	double sum1 = 0;
	int count2 = 0;
	double sum2 = 0;

	scanf("%d %d", &n, &k);
	int i = 0;
	for (i = 1; i <= n; i++)
	{
		if (i % k == 0)
		{
			count1++;
			sum1 += i;
		}
		else
		{
			count2++;
			sum2 += i;
		}
	}
	printf("%.1lf %.1lf", sum1 / count1, sum2 / count2);
	return 0;
}